package com.ruoyi.testing.mapper;

import com.ruoyi.testing.domain.EntrustmentAgreement;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 委托协议Mapper接口
 * 
 * @author ruoyi
 * @date 2023-10-16
 */
public interface EntrustmentAgreementMapper 
{
    /**
     * 查询委托协议
     * 
     * @param id 委托协议主键
     * @return 委托协议
     */
    public EntrustmentAgreement selectEntrustmentAgreementById(String id);

    /**
     * 查询委托协议
     *
     * @param agreementNum 项目编号
     * @return 委托协议
     */
    public EntrustmentAgreement selectEntrustmentAgreementByNum(String agreementNum);

    /**
     * 根据项目类别和年代号获取最大编号
     */
    public Integer selectAgreementNumMax(@Param(value = "itemType") String itemType, @Param(value = "itemYear") String itemYear);


    /**
     * 查询委托协议列表
     * 
     * @param entrustmentAgreement 委托协议
     * @return 委托协议集合
     */
    public List<EntrustmentAgreement> selectEntrustmentAgreementList(EntrustmentAgreement entrustmentAgreement);

    /**
     * 查询项目编号
     */
    List<String> selectEntrustmentAgreementNum();

    /**
     * 新增委托协议
     * 
     * @param entrustmentAgreement 委托协议
     * @return 结果
     */
    public int insertEntrustmentAgreement(EntrustmentAgreement entrustmentAgreement);

    /**
     * 修改委托协议
     * 
     * @param entrustmentAgreement 委托协议
     * @return 结果
     */
    public int updateEntrustmentAgreement(EntrustmentAgreement entrustmentAgreement);

    /**
     * 根据委托号变更状态
     */
    public int updateEntrustmentStateByNum(@Param(value = "state") String state, @Param(value = "agreementNum") String agreementNum);


    /**
     * 删除委托协议
     * 
     * @param id 委托协议主键
     * @return 结果
     */
    public int deleteEntrustmentAgreementById(String id);

    /**
     * 批量删除委托协议
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteEntrustmentAgreementByIds(String[] ids);
}
